import { request } from "@/utils/service"

/**
 * @param data 获取智能体标签列表
 * @returns
 */
export const getRobotLabelList = (data: any) => {
  return request<any>({
    url: "/label/list",
    method: "POST",
    data
  })
}

/**
 * @param data 获取一个智能体的信息
 * @returns
 */
export const getSingleRobotInfo = (data: { id: number }) => {
  return request<any>({
    url: "/robot/get",
    method: "POST",
    data
  })
}

/**
 * @param data 获取智能体列表
 * @returns
 */
export const getRobotList = (data: any) => {
  return request<any>({
    url: "/robot/list",
    method: "POST",
    data
  })
}

/**
 * @param id 删除智能体
 * @returns
 */
export const DeleteRobotId = (data: { id: number }) => {
  return request<any>({
    url: "/robot/del",
    method: "POST",
    data
  })
}

/**
 * @param id 新增智能体
 * @returns
 */
export const AddRobot = (data: any) => {
  return request<any>({
    url: "/robot/add",
    method: "POST",
    headers: {
      "Content-Type": false,
      "Process-Data": false
    },
    data
  })
}

/**
 * @param id 编辑智能体
 * @returns
 */
export const EditRobot = (data: any) => {
  return request<any>({
    url: "/robot/update",
    method: "POST",
    headers: {
      // 'Content-Type': "multipart/form-data",
      // credentials: 'same-origin',
      "Content-Type": false,
      "Process-Data": false
    },
    data
  })
}

/**
 * @param data 修改智能体 - NPC - BASE - LAW
 * @returns
 */
export const UpdateRobotNPC_BASE_LAW = (urlType: string, data: any) => {
  return request<any>({
    url: `/robot/update_${urlType}`,
    method: "POST",
    data
  })
}

/**
 * @param data 智能体的设置
 * @returns
 */
export const UpdateRobotSettingApi = (data: any) => {
  return request<any>({
    url: `/robot/setting`,
    method: "POST",
    data
  })
}
